/**
 * @description  权益行业风险分析
 * @author zls
 */
import React, { PureComponent } from 'react';
import { MinusCircleOutlined } from '@ant-design/icons';
import { Form } from '@ant-design/compatible';
import '@ant-design/compatible/assets/index.css';
import { InputNumberC, InputC } from '@/src/comps';
import colors from '@/src/css/colors';
const redColor = colors.debtAndProfit.text[0];

class InputGroup extends PureComponent {
  constructor() {
    super();
    this.state = {};
  }
  componentDidMount() {}

  render() {
    const { value } = this.props;

    return (
      <div>
        <Form layout='inline'>
          <InputC form={this.props.form} dataIndex={'name'} initialValue={value?.name} />
          <InputNumberC form={this.props.form} dataIndex={'value'} initialValue={value?.value} precision={2} />
          <MinusCircleOutlined style={{ margin: '10px 0 0 10px', color: redColor }} onClick={() => this.props.onDelete()} />
        </Form>
      </div>
    );
  }
}
const onValuesChange = (props, changedValues, allValues) => {
  props?.onChange(allValues);
};
export default Form.create({ onValuesChange: onValuesChange })(InputGroup);
